﻿using System;

namespace CloudTaobao
{
    public class Item
    {
        public string num_iid{get;set;}
        public string title{get;set;}
        public string nick{get;set;}
        public string pic_url { get; set; }
        public string cid { get; set; }
        public string price{get;set;}
        public string post_fee { get; set; }
        public string wap_detail_url { get; set; }
        public string volume { get; set; }
        public string promoted_service { get; set; }
        public string is_prepay { get; set; }
        public Location location { get; set; }
        public int colwidth
        {
            get
            {
                if (pic_url == "")
                    return 456;
                else
                    return 338;
            }
        }
        public string showPic 
        {
            get 
            {
                if (pic_url == "")
                    return "Collapsed";
                else
                    return "Visible";
            }
        }
        public string isPrepay
        {
            get
            {
                if ("true".Equals(is_prepay))
                    return "Visible";
                else
                    return "Collapsed";
            }
        }
        public string oneToThree
        {
            get
            {
                if (promoted_service!=null&&promoted_service.Contains("2"))
                    return "Visible";
                else
                    return "Collapsed";
            }
        }
        public string sevenDay
        {
            get
            {
                if (promoted_service != null&&promoted_service.Contains("4"))
                    return "Visible";
                else
                    return "Collapsed";
            }
        }

        public Item()
        {
            num_iid = "";
            title = "";
            nick = "";
            pic_url = "";
            cid = "";
            price = "";
            post_fee = "";
            wap_detail_url = "";
            volume = "";
            promoted_service = "";
            location = new Location();
        }
    }
}
